// 设置cookie
function setcookie(key, value, day) {
    document.cookie = `${key}=${value};Max-age=${day * 24 * 60 * 60}; path=/`;
}
// 获取cookie
function getcookie(key) {
    let res = null
    let all = document.cookie
    all = all.split(';')
    all.forEach(item => {
        if (item.split('=')[0].trim() == key) {
            res = item.split('=')[1].trim()
        }
    });
    return res
}